package Servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Service.Servlet;
import vo.User;


@WebServlet("/student_cj")
public class Student_cjServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private Servlet a = new Servlet();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		Integer cless_id = Integer.parseInt(request.getParameter("bjid"));
		Integer kc_id = Integer.parseInt(request.getParameter("kcid"));
		List<User> list1 = a.findBybjid1(cless_id, kc_id);
		request.setAttribute("cless_id", cless_id);
		request.setAttribute("kc_id", kc_id);
		request.getSession().setAttribute("list1", list1);
		if(list1.size() == 0){
			request.getRequestDispatcher("abc/aaa.jsp").forward(request, response);						
		}else{
			request.getRequestDispatcher("abc/changecj.jsp").forward(request, response);			
		}
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
